home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / NWBINDRY.PA1 < prev    next >
Text File  |  1994-01-14  |  17KB  |  315 lines

  1. {#Z+}
  2. (*(10U&l12D(s4099T&k2S*)
  3. {***************************************************************************}
  4. {** Program : NWBINDRY                                                    **}
  5. {***************************************************************************}
  6. {** Version : 1.4             ** Started : 11/11/91  ** Ended :   /  /    **}
  7. {***************************************************************************}
  8. {******************************** Description ******************************}
  9. {***************************************************************************}
  10. {** OOP library for Netware API                                           **}
  11. {**                                                                       **}
  12. {** This unit forms the second level object : BINDERY                     **}
  13. {** This object is a descandent of          : NETWARE                     **}
  14. {**                                                                       **}
  15. {**                                                                       **}
  16. {**                                                                       **}
  17. {**                                                                       **}
  18. {***************************************************************************}
  19. {******************************** Information ******************************}
  20. {***************************************************************************}
  21. {** Provides Netware Bindery Services.                                    **}
  22. {**                                                                       **}
  23. {**                                                                       **}
  24. {**                                                                       **}
  25. {** This code is (c) 1991 - 1994 Antonio Covelli. ALL RIGHTS RESERVED.    **}
  26. {** Portions (c) Novell Inc,                                              **}
  27. {**                                                                       **}
  28. {**                                                                       **}
  29. {***************************************************************************}
  30.  
  31. {$I NETWARE.INC}
  32. {#Z-}
  33.  
  34. UNIT NWBINDRY;
  35.  
  36. INTERFACE
  37.  
  38. USES
  39.  
  40.   nwvar,
  41.   netware;
  42.  
  43. TYPE
  44.  
  45.   PBinderyOBJ = ^BinderyOBJ;
  46.   BinderyOBJ  = OBJECT (NetwareOBJ)
  47.  
  48.     { This object provides Netware Bindery Services API's. }
  49.  
  50.     FUNCTION AddBinderyObjectToSet (BinderyObjectName : TObjectName;
  51.                                     BinderyObjectType : OT_BinderyType;
  52.                                     PropertyName : TPropertyName;
  53.                                     MemberName : TObjectName;
  54.                                     MemberType : OT_BinderyType) : WORD;
  55.     { Allows a client to add a member (object) to a group property of an object.
  56.       The property must be of type SET. This call can be used by clients with
  57.       WRITE privileges to the specified property. }
  58.     {#F}
  59.     {}
  60.     { BinderyObjectName: name of the object. }
  61.     { BinderyObjectType: type of the object. }
  62.     { PropertyName     : property name to add this object to. }
  63.     { MemberName       : name of the object who owns the specified property. }
  64.     { MemnerType       : type of the object who owns the specified property. }
  65.     {#F}
  66.  
  67.     FUNCTION ChangeBinderyObjectPassword (BinderyObjectName : TObjectName;
  68.                                           BinderyObjectType : OT_BinderyType;
  69.                                           OldPassword,
  70.                                           NewPassword : TPassword) : WORD;
  71.     { Allows clients to change an object's (usually their own) password. If the
  72.       SUPERVISOR wishes to change an object's password then OLDPASSWORD is
  73.       empty. For encrypted password support see the following:
  74.  
  75.              #KeyedChangePassword#
  76.              #KeyedVerifyPassword# }
  77.     {#F}
  78.     {}
  79.     { BinderyObjectName: name of the object. }
  80.     { BinderyObjectType: type of the object. }
  81.     { OldPassword      : the old password of the object. }
  82.     { NewPassword      : the new password to be assigned to the object. }
  83.     {#F}
  84.  
  85.     FUNCTION ChangeBinderyObjectSecurity (BinderyObjectName : TObjectName;
  86.                                           BinderyObjectType : OT_BinderyType;
  87.                                           NewObjectSecurity : BYTE) : WORD;
  88.     { Allows a client to change the security access level of the specified
  89.       object. The client must have security access levels equal to the object
  90.       it wants to change. }
  91.     {#F}
  92.     {}
  93.     { BinderyObjectName: name of the object. }
  94.     { BinderyObjectType: type of the object. }
  95.     { NewObjectSecurity: new access security assigned to the object. See Bindery
  96.                     Security Types in NWVAR.PAS. }
  97.     {#F}
  98.  
  99.     FUNCTION ChangePropertySecurity (BinderyObjectName : TObjectName;
  100.                                      BinderyObjectType : OT_BinderyType;
  101.                                      PropertyName : TPropertyName;
  102.                                      NewPropertySecurity : BYTE) : WORD;
  103.     { Allows a client to change the security access level of a property for
  104.       the specified object. This call can be used by clients who have Property
  105.       Creation privileges for the specified object and Property Read and Write
  106.       privileges for the specified property. }
  107.     {#F}
  108.     {}
  109.     { BinderyObjectName: name of the object. }
  110.     { BinderyObjectType: type of the object. }
  111.     { PropertyName     : name of the property whose security will be modified. }
  112.     { NewObjectSecurity: new access security assigned to the property. See
  113.                     Bindery Security Types in NWVAR.PAS. }
  114.     {#F}
  115.  
  116.     FUNCTION ChangeUserPassword (BinderyObjectName : TObjectName;
  117.                                  OldPassword,
  118.                                  NewPassword : TPassword) : word;
  119.     { Allows clients to change an object's (USERS only) password. If the
  120.       SUPERVISOR wishes to change a user's password then OLDPASSWORD is empty. }
  121.     {#F}
  122.     {}
  123.     { BinderyObjectName: name of the USER. }
  124.     { OldPassword      : the old password of the object. }
  125.     { NewPassword      : the new password to be assigned to the object. }
  126.     {#F}
  127.  
  128.     FUNCTION CloseBindery : WORD;
  129.     { This call allows a SUPERVISOR or SUPERVISOR EQUIVALENT object to close
  130.       the default file server's bindery files. When the bindery is closed many
  131.       of the network functions are disabled. }
  132.  
  133.     FUNCTION CreateBinderyObject (BinderyObjectName : TObjectName;
  134.                                   BinderyObjectType : OT_BinderyType;
  135.                                   ObjectFlags, ObjectSecurity : BYTE) : WORD;
  136.     { Allows clients to create objects within the bindery. A client cannot set
  137.       security access levels equal to "File Server" access. Only SUPERVISORS and
  138.       objects listed in the WORKGROUP_MANAGERS property can make this call.
  139.  
  140.       Bit 0 of ObjectFlags should be set if the object is dynamic (object is
  141.                removed from the bindery when the server is downed.)
  142.  
  143.       Bit 0 of ObjectFlags should be cleared if the object is static (object is
  144.                NOT removed from the bindery when the server is downed.) }
  145.  
  146.     FUNCTION CreateProperty (BinderyObjectName : TObjectName;
  147.                              BinderyObjectType : OT_BinderyType;
  148.                              PropertyName : TPropertyName;
  149.                              PropertyFlags, PropertySecurity : BYTE) : WORD;
  150.     { Allows clients to create properties for the specified object. See
  151.       #CreateBinderyObject# for more information. }
  152.  
  153.     FUNCTION DeleteBinderyObject (BinderyObjectName : TObjectName;
  154.                                   BinderyObjectType : OT_BinderyType) : WORD;
  155.     { Removes an object and all of its associated properties from the bindery.
  156.       Only a client that is object supervisor of the specified object can make
  157.       this call. Clients are NOT allowed to remove objects that have FileServer
  158.       security levels. }
  159.  
  160.     FUNCTION DeleteBinderyObjectFromSet (BinderyObjectName : TObjectName;
  161.                                          BinderyObjectType : OT_BinderyType;
  162.                                          PropertyName : TPropertyName;
  163.                                          MemberName : TObjectName;
  164.                                          MemberType : OT_BinderyType) : WORD;
  165.  
  166.     { Allows a client to remove a bindery object from a set property of the
  167.       specified object. }
  168.  
  169.     FUNCTION DeleteProperty (BinderyObjectName : TObjectName;
  170.                              BinderyObjectType : OT_BinderyType;
  171.                              PropertyName : TPropertyName) : WORD;
  172.  
  173.     { Removes the property attached to the object and disposes of the property
  174.       from the file server's bindery. }
  175.  
  176.     FUNCTION GetBinderyAccessLevel (VAR SecurityAccessLevel : BYTE;
  177.                                     VAR ObjectID : OT_BinderyID) : WORD;
  178.     { Returns the security access level the logged in object has in the
  179.       bindery as well as the object id. }
  180.  
  181.     FUNCTION GetBinderyObjectAccessLevel (ObjectID : OT_BinderyID;
  182.                                           VAR SecurityAccessLevel : BYTE) : WORD;
  183.     { Returns the security access level the specified object has in the
  184.       bindery. }
  185.  
  186.     FUNCTION GetBinderyObjectID (BinderyObjectName : TObjectName;
  187.                                  BinderyObjectType : OT_BinderyType;
  188.                                  VAR ObjectID : OT_BinderyID) : WORD;
  189.     { Returns the specified bindery object's unique ID number (Object ID). }
  190.  
  191.     FUNCTION GetBinderyObjectName (ObjectID : OT_BinderyID;
  192.                                    VAR BinderyObjectName : TObjectName;
  193.                                    VAR BinderyObjectType : OT_BinderyType) : WORD;
  194.     { Returns the specified bindery object ID's full name and type. }
  195.  
  196.     FUNCTION IsBinderyObjectInSet (BinderyObjectName : TObjectName;
  197.                                    BinderyObjectType : OT_BinderyType;
  198.                                    PropertyName : TPropertyName;
  199.                                    MemberName : TObjectName;
  200.                                    MemberType : OT_BinderyType) : WORD;
  201.     { Allows a client to verify whether an object appears as a member in a set
  202.       property. This call can be used by any client with read privileges to the
  203.       set property. }
  204.  
  205.     function IsCallingStationAManager : word;
  206.     { Allows a workstation to verify whether it is has manager clearance. }
  207.  
  208.     function KeyedChangePassword (BinderyObjectName : TObjectName;
  209.                                   BinderyObjectType : OT_BinderyType;
  210.                                   Key : TEncryptKey;
  211.                                   NewPassword : TPassword) : word;
  212.     { Allows clients to change an object's (USERS only) password. If the
  213.       SUPERVISOR wishes to change a user's password then OLDPASSWORD is empty.
  214.       This function uses the encryption method by using a special key. }
  215.  
  216.     function KeyedVerifyPassword (BinderyObjectName : TObjectName;
  217.                                   BinderyObjectType : OT_BinderyType;
  218.                                   Key : TEncryptKey) : word;
  219.     { Allows an object to verify (usually its own) password. This function
  220.       uses the encryption method by using a special key. }
  221.  
  222.     function ListRelationsOfAnObject (BinderyObjectName : TObjectName;
  223.                                       BinderyObjectType : OT_BinderyType;
  224.                                       PropertyName : TPropertyName;
  225.                                       var Relations : TLongint32Array;
  226.                                       var LastRecord : longint) : word;
  227.     { NO DOCUMENTATION AVAILABLE AS OF YET }
  228.  
  229.     FUNCTION OpenBindery : WORD;
  230.     { This call allows a SUPERVISOR or SUPERVISOR EQUIVALENT object to open
  231.       the default file server's bindery files. }
  232.  
  233.     FUNCTION ReadPropertyValue (BinderyObjectName : TObjectName;
  234.                                 BinderyObjectType : OT_BinderyType;
  235.                                 PropertyName : TPropertyName;
  236.                                 SegmentNumber : WORD;
  237.                                 VAR PropertyValue : TPropertyValue;
  238.                                 VAR MoreSegments,
  239.                                 PropertyFlags : BYTE) : WORD;
  240.     { Allows a client to retrieve the contents of the specified property.
  241.       Property values are stored in 128 byte segments. }
  242.     {}
  243.     { The Segment number must be 1 to read the first segment and then
  244.       incremented by one for each subsequent segment. }
  245.  
  246.     FUNCTION RenameBinderyObject (BinderyObjectName,
  247.                                   NewBinderyObjectName : TObjectName;
  248.                                   BinderyObjectType : OT_BinderyType) : WORD;
  249.     { Renames the specified bindery object. The new name must not already be
  250.       defined for that particular object type. It is ok to have a group and
  251.       a user with the same name. }
  252.  
  253.     FUNCTION ScanBinderyObject (SearchObjectName : TObjectName;
  254.                                 SearchObjectType : OT_BinderyType;
  255.                                 VAR ObjectID : OT_BinderyID;
  256.                                 VAR BinderyObjectName : TObjectName;
  257.                                 VAR BinderyObjectType : OT_BinderyType;
  258.                                 VAR ObjectHasProperties,
  259.                                 ObjectFlags, ObjectSecurity : BYTE) : WORD;
  260.     { Allows a client to scan the file server's bindery to determine what
  261.       objects exist. The ObjectID should be set to -1 for the first call and
  262.       then passed back in for subsequent calls. This call can be made by any
  263.       client if the object exists within the bindery and if the client has
  264.       search privileges to the object. }
  265.  
  266.     FUNCTION ScanBinderyObjectTrusteePaths (ObjectID : OT_BinderyID;
  267.                                             VolumeNumber : BYTE;
  268.                                             VAR SequenceNumber : WORD;
  269.                                             VAR TrusteeAccessMask : BYTE;
  270.                                             VAR TrusteePathName : TPathName) : WORD;
  271.     { This call allows a client to retrieve all of the trustee assignments that
  272.       a given client has to a volume. SequenceNumber should be set to -1 for the
  273.       first call and then passed back in for subsequent calls. }
  274.  
  275.     FUNCTION ScanProperty (BinderyObjectName : TObjectName;
  276.                            BinderyObjectType : OT_BinderyType;
  277.                            SearchPropertyName : TPropertyName;
  278.                            VAR SequenceNumber : LONGINT;
  279.                            VAR PropertyName : TPropertyName;
  280.                            VAR PropertyFlags, PropertySecurity,
  281.                            PropertyHasValue, MoreProperties : BYTE) : WORD;
  282.     { This call allows a client to scan the properties that are associated with
  283.       the speficied object. SequenceNumber must be set to -1 for the first call
  284.       and passed back in on subsequent calls. This call can be used by clients
  285.       who have read privileges for both the object and property. }
  286.  
  287.     FUNCTION VerifyBinderyObjectPassword (BinderyObjectName : TObjectName;
  288.                                           BinderyObjectType : OT_BinderyType;
  289.                                           Password : TPassword) : WORD;
  290.     { Allows an object to verify (usually its own) password. }
  291.  
  292.     FUNCTION WritePropertyValue (BinderyObjectName : TObjectName;
  293.                                  BinderyObjectType : OT_BinderyType;
  294.                                  PropertyName : TPropertyName;
  295.                                  SegmentNumber : WORD;
  296.                                  PropertyValue : TPropertyValue;
  297.                                  MoreSegments : BYTE) : WORD;
  298.     { Allows clients to write values to the specified property. This call can
  299.       be made by any client who has write privileges to the property. }
  300.  
  301.     private
  302.  
  303.     FUNCTION MemberBinderyCall (BinderyFunctionNumber : WORD;
  304.                                 BinderyObjectName : TObjectName;
  305.                                 BinderyObjectType : OT_BinderyType;
  306.                                 PropertyName : TPropertyName;
  307.                                 MemberName : TObjectName;
  308.                                 MemberType : OT_BinderyType) : WORD;
  309.     { Used by SET api's. PRIVATE FUNCTION. }
  310.  
  311.     DESTRUCTOR  Done; VIRTUAL;
  312.  
  313.   END;
  314.  
  315.